package cn.fl.ref.asspackinfo.transform;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.BeanUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.ref.asspackinfo.vo.FncPrjPayRltvInfoReplaceVO;
import fl.ref.asspackinfo.dto.FncPrjPayRltvInfoReplaceDTO;

public class FncPrjPayRltvInfoReplaceVOTransform {

	/**
	 * DTO 转 VO
	 * @param dto
	 * @return
	 */
	public static FncPrjPayRltvInfoReplaceVO toVO(FncPrjPayRltvInfoReplaceDTO dto){
		FncPrjPayRltvInfoReplaceVO vo = null;
		if(dto != null){
			vo = new FncPrjPayRltvInfoReplaceVO();
			BeanUtils.copyProperties(dto, vo);
		}
		return vo;
	}
	
	/**
	 * VO 转 DTO
	 * @param dto
	 * @return
	 */
	public static FncPrjPayRltvInfoReplaceDTO toDTO(FncPrjPayRltvInfoReplaceVO vo){
		FncPrjPayRltvInfoReplaceDTO dto = null;
		if(vo != null){
			dto = new FncPrjPayRltvInfoReplaceDTO();
			BeanUtils.copyProperties(vo, dto);
		}
		return dto;
	}
	
	/**
	 * DTO集合 转 VO集合
	 * 
	 * @param list
	 * @return
	 */
	public static List<FncPrjPayRltvInfoReplaceVO> toVOList(List<FncPrjPayRltvInfoReplaceDTO> list){
		List<FncPrjPayRltvInfoReplaceVO> voList = new ArrayList<FncPrjPayRltvInfoReplaceVO>();
		if(CollectionUtils.isNotEmpty(list)){
			for(FncPrjPayRltvInfoReplaceDTO dto : list){
				voList.add(toVO(dto));
			}
		}
		return voList;
	}
	
}
